import socket
import time
HOST = '0.0.0.0'                 
PORT = 3306              
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((HOST, PORT))
s.listen(1)
c = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
c.connect(('192.168.80.131', 3306))
c.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
# data = c.recv(1024)

# print data

conn, addr = s.accept()
print 'Connected by', addr
while 1:
    data=c.recv(20480)
    print data
    conn.sendall(data)
    data=conn.recv(20480)
    print data
    c.send(data)
    # time.sleep(3)
conn.close()

